The overarching theme of this investigation is the quantification and mapping of gentrification in Los Angeles County, California. One key negative impact of gentrification is the displacement of lower income households due to steep rent increases.
To analyse this spatial distribution, a map of the change in median gross rent from 2000 - 2015. Shapefiles are provided by the Los Angeles County GIS Data Portal and rent data from the Urban Displacement Project.
QGIS Map
Base layer for QGIS Map was obtained from Spatial Analyst Felix Rohrbach’s blog (Rohrbach, 2016).
Critique of QGIS Mapping
Preparing variables and dataframe
#Loading LA County Census Tract polygons
LAcensustract <- rgdal::readOGR("Census Tracts 2010.geojson", "OGRGeoJSON")
## OGR data source with driver: GeoJSON
## Source: "/Users/annaseng/Documents/GitHub/gis_code/Census Tracts 2010.geojson", layer: "OGRGeoJSON"
## with 2345 features
## It has 7 fields
sfLAcensustract <- st_as_sf(LAcensustract)
#Reorder columns to make census tract nummber the first column which is the default hover visual for tmap_leaflet
sfLAcensustract <- sfLAcensustract[c(4,1,2,3,5,6,7,8)]
#create variable from downloaded csv file with relevant information on house prices
ucladata <- read.csv('ucladata.csv')
#check for numeric class
class(ucladata$chg_mgr15)
## [1] "numeric"
After preparing separate variables, join to create a combined variable:
#Append census data to sfLAcensustract
CensusTractDataMap <- append_data(sfLAcensustract,ucladata, key.shp = "ct10", key.data = "Census_ID", ignore.duplicates = TRUE, ignore.na = FALSE)
## Under coverage: 4 out of 2345 shape features did not get appended data. Run under_coverage() to get the corresponding feature id numbers and key values.
#Remove any rows with missing data
CensusTractDataMap3 <- CensusTractDataMap[!(is.na(CensusTractDataMap$chg_mgr15)), ]
Plotting of maps using tmap and leaflet
tm2 <- tm_shape(CensusTractDataMap3) +
tm_polygons("chg_mgr15",
style = "fixed", breaks = c(-Inf, -750, 0, 371, 750, 1500, 2500, Inf),
palette = "-RdYlGn",
midpoint=0,
title="County Median = $371") +
tm_scale_bar(position = c("right", "bottom")) +
tm_layout(title = "Changes in Median Gross Rent, 2000-2015")
#create leaflet
leaflet1 <- tmap_leaflet(tm2)
leaflet1